'''
Created on 05/03/2009

@author: eh01
'''
from domain.message import Message
from requesthandler.requesthandlerconst import HTTP_HEADER_CONTENT_TYPE

def createMessage(request, node_id):
    message = Message()
    return updateMessage(request, node_id, message)

def updateMessage(request, node_id, message):
    message.nodeId = node_id
    message.contentType = request.headers[HTTP_HEADER_CONTENT_TYPE]
    message.body = request.body
    return message    